import { useRef } from "react";

export const useFd = () => {
  const timer = useRef(null);
  function fd(cb) {
    return (arg)=>{
      clearInterval(timer.current);
      timer.current = setTimeout(() => {
        cb(arg);
      }, 500);
    };
  }

  return fd;
};
